UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wx+1ldvMe452u5qubFFFZ+yCJtF/yx2Vq2qeeXXHcjM='
WHERE
key_id = '7bf2c60ad77efc9279be16f96025799414ea44e69c427761c3b4ea6ad484b7af'
AND (
token = 'wx+1ldvMe452u5qubFFFZ+yCJtF/yx2Vq2qeeXXHcjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)