UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hED9EozJ9RldvYGTdsvCMzqNOBzy+tTwKUSYx7D9csc='
WHERE
key_id = '076134169749ea77e92aa48913048f10af99d34424e987b77bbd815242a8a25b'
AND (
token = 'hED9EozJ9RldvYGTdsvCMzqNOBzy+tTwKUSYx7D9csc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)