UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm41Vpf7mp3Q3dMT9SSsYqYt4Azi9kleDmEGqVFK4B8Y=' 
WHERE 
  key_id = '8284a64cb72101fb1c7180ab1166835b6c21d8a8704a827e43e67b608239686b' 
  AND (
    token = 'm41Vpf7mp3Q3dMT9SSsYqYt4Azi9kleDmEGqVFK4B8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00135