UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mtSarT9omZQuyBp/ZCgjC09hfI45vjOMd8OrYeBlCMQ=' 
WHERE 
  key_id = '88e306dd677647308f02bce757bf58739ecad1c53f8fc404000d879c75a3366e' 
  AND (
    token = 'mtSarT9omZQuyBp/ZCgjC09hfI45vjOMd8OrYeBlCMQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040