UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ngQabU9R6yxG2d5wV5H0x9b4DQwYdEpwgg4OnQ7JUh8='
WHERE
key_id = '3152753877ef6ce939f1faf2e15e4682950b469fbc370b822aece3be02cabc2f'
AND (
token = 'ngQabU9R6yxG2d5wV5H0x9b4DQwYdEpwgg4OnQ7JUh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)