UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cRIydkfIJ9SUGt/DKxDuRcfM7ZvVSH4oGrJflBF3wE0='
WHERE
key_id = '634c59c915e4b87039239f7958c1ed1bba35654c96aa95f0c9eb5f3302fcfb7e'
AND (
token = 'cRIydkfIJ9SUGt/DKxDuRcfM7ZvVSH4oGrJflBF3wE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)