UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x/d5LzjuyqfoF6XhLEbdPiMZb6G4734XGgJIR2H3aAc=' 
WHERE 
  key_id = '9357afbe0a3feac77f1b533e251e55b66af22c8a5e9a462aa396deb9251213d7' 
  AND (
    token = 'x/d5LzjuyqfoF6XhLEbdPiMZb6G4734XGgJIR2H3aAc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057