UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bodMYkDDnoEzcldnbgp1xM2VsReZ0eKGgLsUf203m1c=' 
WHERE 
  key_id = 'a47848773ed74b35350f06023933b52981021900e1ebb353913ce2de76bf834e' 
  AND (
    token = 'bodMYkDDnoEzcldnbgp1xM2VsReZ0eKGgLsUf203m1c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036