UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cH669l6WgMnrW2ZQtZ+NrDyTW8qADtRncW9TtkN08nQ='
WHERE
key_id = '41dceba9dc37df6fc0b87442e7de3f8e84c5919ed8ec263423d5b904ff70dd38'
AND (
token = 'cH669l6WgMnrW2ZQtZ+NrDyTW8qADtRncW9TtkN08nQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)