UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5W1X2trJX5qSjNNyI3FIfzXR/SmQw42zJC/WAhHZp8='
WHERE
key_id = '2953ce02299e3073d98f0584a2c46ce02f625ce3a03452d7e528ca0f266323cd'
AND (
token = 'G5W1X2trJX5qSjNNyI3FIfzXR/SmQw42zJC/WAhHZp8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)