UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zKj2rjjxypgxnnDJJ5xks6Xs98gyA0x/A5Bfo956wq4='
WHERE
key_id = 'a00db607c0c07fb44978744c5e0414069fbd01641905c8e3466585fb338f252b'
AND (
token = 'zKj2rjjxypgxnnDJJ5xks6Xs98gyA0x/A5Bfo956wq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)