UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r4DD5+fFwfzEXxlOvVV/pmWwkQqNY4YvJUfhUrHYAd8=' 
WHERE 
  key_id = 'c868ed7378eeb4620e40f75fec015b1d0e6550c3ee4e0cb7eba4f68dee2f3965' 
  AND (
    token = 'r4DD5+fFwfzEXxlOvVV/pmWwkQqNY4YvJUfhUrHYAd8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057