UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'famjejL83+31kxtIjnrlqbhNxgoFP9mkfy4MSTpWYnI='
WHERE
key_id = '6859441c65746608b3de342e77e20345da36c5461b483498462311ca2ff21742'
AND (
token = 'famjejL83+31kxtIjnrlqbhNxgoFP9mkfy4MSTpWYnI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)