UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EotSbFEvdKk1k34jomnC+q0IPUkP8N2/kDa58rmjiDc=' 
WHERE 
  key_id = 'ab87e4eb545cb447d4e67b29842cf37daa609de00645c6d87d99296f79083d6b' 
  AND (
    token = 'EotSbFEvdKk1k34jomnC+q0IPUkP8N2/kDa58rmjiDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039