UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tMMpNLHsPu2iBo6uy/cky/n9qsBqgpGcC2NTfTHRb6U='
WHERE
key_id = 'd3c7a8e742923ece2eb84392bdc5cfed3e338b1ac88cdd2423546847947afe7f'
AND (
token = 'tMMpNLHsPu2iBo6uy/cky/n9qsBqgpGcC2NTfTHRb6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)