UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rfxy0F+KHH3VLAKKCubXXmCgGW8ovexotrAkMbj8AL8=' 
WHERE 
  key_id = 'cd35cdb3258f9f305c08c3e2ef6161c5e7ad92ff264fe5b28e2f0221f64347cc' 
  AND (
    token = 'rfxy0F+KHH3VLAKKCubXXmCgGW8ovexotrAkMbj8AL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051