UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jN0T51AWBqSYDwuv3xVz17KqodgJiD36o8BidZIKa/w=' 
WHERE 
  key_id = '04f379c7d522dfb094e4235b7de720aeb26764443bcbdad22c7420efeada198d' 
  AND (
    token = 'jN0T51AWBqSYDwuv3xVz17KqodgJiD36o8BidZIKa/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026