UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N44+HSGL39StXqyjzt+pjdz1PjkkLcheWGF3XiF7LLc=' 
WHERE 
  key_id = 'acaf6d886e1cb8321655404b2649a5fa9eb34b3c4c95c4d6407e46a29ac27976' 
  AND (
    token = 'N44+HSGL39StXqyjzt+pjdz1PjkkLcheWGF3XiF7LLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030