UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B7Lq8FuwjsQcy0keRvxSNWtbmVTguo8Um4d13WOfXss=' 
WHERE 
  key_id = '2f9ac9fa558db59338ab918ef98a755eefc9990eefe3e29c949410ba26d09b9b' 
  AND (
    token = 'B7Lq8FuwjsQcy0keRvxSNWtbmVTguo8Um4d13WOfXss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024