UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kpK+YPEigPUZMW+9zVuvZWOrtXUFO1YIQCoW4ymYqUU='
WHERE
key_id = '55c2dbc05b7930b645d0cdc3c0734271414c2c7b3631720792fbdba5ecb13618'
AND (
token = 'kpK+YPEigPUZMW+9zVuvZWOrtXUFO1YIQCoW4ymYqUU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)