UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VXp3T3NByjToyFLLVr6J1G7jLwkFqNnUxtPDf8fMB74='
WHERE
key_id = '17e347ef615dcc1a401ea77cf6f26114f0e1989184735f60ab74cc888968112a'
AND (
token = 'VXp3T3NByjToyFLLVr6J1G7jLwkFqNnUxtPDf8fMB74='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)