UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FklcrhCI0teHkG6uDDKd1/dTs/UwQn3Pnu+8QJzpKFI=' 
WHERE 
  key_id = '299210589cefca17b7553d0b33bb2a439ff06d0462e250ae8b5469e157e92abd' 
  AND (
    token = 'FklcrhCI0teHkG6uDDKd1/dTs/UwQn3Pnu+8QJzpKFI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036