UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VJYcrQGOEnF4r37iumADxwJkAnuC5HWfU9k2F/KaP34='
WHERE
key_id = '796b957b82a2601de7ba52e8a097f535df2c0ed72d0ff27b3f1964986bc1e054'
AND (
token = 'VJYcrQGOEnF4r37iumADxwJkAnuC5HWfU9k2F/KaP34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)