UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7xzEVfWCj995Pb2DJl74Do6GgvGj5azuvyuULvbG4Ss='
WHERE
key_id = 'b54db8afdacacf8277919bcad4e474877cef970f700ba86da79d0b5850d59bad'
AND (
token = '7xzEVfWCj995Pb2DJl74Do6GgvGj5azuvyuULvbG4Ss='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)