UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZOnR11cBmPn/B7pIepEMAVRnfy1CQ6kR3HL5P1ql5I=' 
WHERE 
  key_id = '763a018d4091fe077e93d7b1331b5cd77702cf279373fb9812c8063addab8149' 
  AND (
    token = 'lZOnR11cBmPn/B7pIepEMAVRnfy1CQ6kR3HL5P1ql5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040