UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JaPzGCorPRYmVxStl8vV2+jsY04OKP8eAeT7FG4hh30=' 
WHERE 
  key_id = '18244eefda9de3efbe36fbd13b24f3645396fd05bc4868b240b34be9f21ae0a3' 
  AND (
    token = 'JaPzGCorPRYmVxStl8vV2+jsY04OKP8eAeT7FG4hh30=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027