UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aS5+J7O0vkNshSYeIexkbQpUAPbVgybCMxy2FIitYVE='
WHERE
key_id = '99bcee0d17328005ac1fef13b04c9dd1f2234b2db67259436cafedd7fcab7323'
AND (
token = 'aS5+J7O0vkNshSYeIexkbQpUAPbVgybCMxy2FIitYVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)