UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kgCSC4EZQWQUco52NAYdqDAU+I0NlB/uwh0eGQwwBNI='
WHERE
key_id = '299c3afaf56a2f18fa3d3a784588d9c6eaef26b64bd3dd951c442eaf2702a446'
AND (
token = 'kgCSC4EZQWQUco52NAYdqDAU+I0NlB/uwh0eGQwwBNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)