UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'idXPeL14yOFBeqDkLGjDpAiSyBPTNIEsHstAuxGq9MA='
WHERE
key_id = 'e19348235023efc6db09b55f944db2fe871ffada0ad83c56f4aba91ad43242e6'
AND (
token = 'idXPeL14yOFBeqDkLGjDpAiSyBPTNIEsHstAuxGq9MA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)